#include <bitset>
#include <cstdio>

const int N = 55, M = 20;
int n, m, str[N][M], cnt[1 << M];
double f[1 << M];
std::bitset<N> bit[1 << M];

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("B.in", "r", stdin);
  freopen("B.out", "w", stdout);
#endif
#endif

  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < m; ++j) scanf("%d", &str[i][j]);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (i != j) {
        int tmp = 0;
        for (int k = 0; k < m; ++k) {
          if (str[i][k] == str[j][k]) tmp |= 1 << k;
        }
        bit[tmp].set(i);
      }
    }
  }
  for (int i = (1 << m) - 1; ~i; --i) {
    for (int j = 0; j < m; ++j) {
      if ((i >> j) & 1) bit[i ^ (1 << j)] |= bit[i];
    }
  }
  double ans = 0;
  f[0] = 1;
  for (int i = 1; i < 1 << m; ++i) { cnt[i] = cnt[i >> 1] + (i & 1); }

  for (int i = 0; i < 1 << m; ++i) {
    ans += bit[i].count() * f[i] / n;
    for (int j = 0; j < m; ++j) {
      if (!((i >> j) & 1)) f[i | 1 << j] += f[i] / (m - cnt[i]);
    }
  }
  printf("%.5lf", ans);
  return 0;
}